package com.neusoft.resturant.controller;


import com.neusoft.resturant.common.utils.R;
import com.neusoft.resturant.entity.District;
import com.neusoft.resturant.service.IDistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("districts")
public class    DistrictController extends BaseController {
    @Autowired
    private IDistrictService districtService;

    @GetMapping({"/", ""})
    public R getDistrict(String parent) {
        List<District> list = districtService.getParent(parent);
        return R.success(list);
    }
}
